return val
- log.debug("parseConfig: config is %s" % str(config))
+ log.debug("parseConfig: config is %s", config)
result = {}
log.warn("Ignoring malformed and deprecated config option "
"restart = %s", restart)
- log.debug("parseConfig: result is %s" % str(result))
+ log.debug("parseConfig: result is %s", result)
return result
except KeyError, exn:
log.exception(exn)
- raise VmError('Unspecified domain detail: %s' % str(exn))
+ raise VmError('Unspecified domain detail: %s' % exn)
def readVm(self, *args):
if self.infoIsSet(k):
to_store[k] = str(self.info[k])
- log.debug("Storing VM details: %s" % str(to_store))
+ log.debug("Storing VM details: %s", to_store)
self.writeVm(to_store)
for v in range(0, self.info['vcpus']):
to_store["cpu/%d/availability" % v] = availability(v)
- log.debug("Storing domain details: %s" % str(to_store))
+ log.debug("Storing domain details: %s", to_store)
self.writeDom(to_store)
def shutdown(self, reason):
if not reason in shutdown_reasons.values():
- raise XendError('invalid reason:' + reason)
+ raise XendError('Invalid reason: %s' % reason)
self.storeDom("control/shutdown", reason)
if reason != 'suspend':
self.storeDom('xend/shutdown_start_time', time.time())
"""
log.debug('XendDomainInfo.construct: %s %s',
- str(self.domid),
- str(self.info['ssidref']))
+ self.domid,
+ self.info['ssidref'])
self.domid = xc.domain_create(dom = 0, ssidref = self.info['ssidref'])
def initDomain(self):
log.debug('XendDomainInfo.initDomain: %s %s %s',
- str(self.domid),
- str(self.info['memory_KiB']),
- str(self.info['cpu_weight']))
+ self.domid,
+ self.info['memory_KiB'],
+ self.info['cpu_weight'])
if not self.infoIsSet('image'):
raise VmError('Missing image in configuration')
def destroy(self):
"""Cleanup VM and destroy domain. Nothrow guarantee."""
- log.debug("XendDomainInfo.destroy: domid=%s", str(self.domid))
+ log.debug("XendDomainInfo.destroy: domid=%s", self.domid)
self.cleanupVm()
self.destroyDomain()
def destroyDomain(self):
- log.debug("XendDomainInfo.destroyDomain(%s)", str(self.domid))
+ log.debug("XendDomainInfo.destroyDomain(%s)", self.domid)
try:
if self.domid is not None:
dom = 0
# get max number of vcpus to use for dom0 from config
target = int(xroot.get_dom0_vcpus())
- log.debug("number of vcpus to use is %d" % (target))
+ log.debug("number of vcpus to use is %d", target)
# target = 0 means use all processors
if target > 0:
# count the number of online vcpus (cpu values in v2c map >= 0)
vcpu_to_cpu = dom_get(dom)['vcpu_to_cpu']
vcpus_online = len(filter(lambda x: x >= 0, vcpu_to_cpu))
- log.debug("found %d vcpus online" % (vcpus_online))
+ log.debug("found %d vcpus online", vcpus_online)
# disable any extra vcpus that are online over the requested target
for vcpu in range(target, vcpus_online):
- log.info("enforcement is disabling DOM%d VCPU%d" % (dom, vcpu))
+ log.info("enforcement is disabling DOM%d VCPU%d", dom, vcpu)
self.vcpu_hotplug(vcpu, 0)